from selenium import webdriver
from selenium.webdriver.common.by import By



driver=webdriver.Chrome()
driver.get("http://192.168.46.5:18089/login")
driver.find_element(By.NAME,"username").send_keys("XTGLY")
driver.find_element(By.NAME,"password").send_keys("123456")
driver.implicitly_wait(3)
driver.find_element(By.NAME,"signIn").click()

# 在商品管理页面点击“新增”按钮
driver.find_element(By.XPATH,'//*[@id="app"]/div/div[2]/section/div/div[2]/div[3]/button').click()

# 在新增页面中上传图片。  找到file标签  send_keys(r+路径)
driver.find_element(By.NAME,"file").send_keys(r"C:\Users\speakj\Pictures\Camera Roll\222.png")